<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 默认值 如果没有传值，就用默认值，如果传值了就用传进来的值
        let [a=1] = [666];
        console.log(a);
        // 默认值是表达式，惰性求职。就是只有用着默认值时，表达式才会执行，性能好
        function fn() {
            console.log('表达式执行了！！！');
            return 'b'
        }
        let [b=fn()] = [8];
        console.log(b);
        // ... 展开运算符 剩余运算符
        let arr3 = [1,2,3,4];
        let arr4 = [...arr3];
        // 数组的深拷贝
        arr4[0] = 7;
        console.log(arr3);
        console.log(arr4);
        // 剩余运算符
        let [a1,...b1] = [1,2,3,4,5];
        console.log(a1);
        console.log(b1);
    </script>
</body>
</html>